
from driver import ADC
import utime as time
from driver import GPIO


adc0 = ADC()
adc1=ADC()
adc0.open("ai1")
adc1.open("ai2")

di1=GPIO()
di1.open("di1")
di2=GPIO()
di2.open("di2")


def get_ai_current_value():
    value1="%.4f" %(adc0.readVoltage()/150000)
    value2="%.4f" %(adc1.readVoltage()/150000)
    # print("current value of ai:",value1,value2)    
    return float(value1),float(value2)


def get_ai_voltage_value():
    value1=adc0.readVoltage()*1.5
    value2=adc1.readVoltage()*1.5
    # print("viltage value of ai:",value1,value2)  
    return value1,value2

def get_di_value():
    value1=di1.read()
    value2=di2.read()
    print("values of di1,di2:",value1,value2)   

    return value1,value2